<?php

namespace app\common\model;

use think\Model;

class WishList extends Model
{
    protected $modelValidate=true;
    protected $resultSetType = 'collection';

    /**
     * @return \think\model\relation\BelongsTo
     */
    public function gainMoney()
    {
        return $this->hasMany(WishListMoney::class,'wish_list_id','id');
    }

    public function member()
    {
        return $this->hasMany(Member::class,'id','member_id');
    }

    /**
     * @return false|\PDOStatement|string|\think\Collection
     * @throws \think\db\exception\DataNotFoundException
     * @throws \think\db\exception\ModelNotFoundException
     * @throws \think\exception\DbException
     */
     public static function wishList()
     {
       return self::where('status',10)
           ->with(['gainMoney'])
           ->limit(10)
           ->order('id','asc')
           ->select();

     }

}